<template>
  <el-form :disabled="disabled" ref="form" class="edit-main-box" :model="formData" :rules="rules" label-position="right"
    label-width="100px">
    <el-row>
      <el-col :span="8">
        <el-form-item label="名称" prop="name">
          <el-input v-model="formData.name" placeholder="请输入" />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="值" prop="value">
          <el-input v-model="formData.value" placeholder="请输入" />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="值" prop="isImportant">
          <el-switch v-model="formData.isImportant" active-color="#13ce66" inactive-color="#EEE" />
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
import FormMixin from "@/views/product/form-mixin.js";
export default {
  name: 'LabelValue',
  mixins: [FormMixin],
  props: {
    value: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      rules: {
        name: [{ required: true, message: '请输入', trigger: 'blur' }],
        value: [{ required: true, message: '请输入', trigger: 'blur' }]
      },
      lst_cate: []
    }
  },
  computed: {
    formData: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }
  },
  methods: {
    validate() {
      return this.$refs.form.validate()
    }
  }
}
</script>
